var Page_Home = {};

<?php
	render('/Javascript/Snippet.Url.js');
?>

$(document).ready
(
	function() 
	{

		$('#post').click(function(){
			$('#post_form').submit();
		});

		$('#update_status').click(function(){
			updateStatus();
		});

		$('#user_logout').click(function(){
			userLogout();
		});
	}
)


function updateStatus() {
	
	var efId = $('#efId').val();
	var state = $('#state').val();
	var socialNetwork = $('#socialNetwork').val();

	Common.Api.callJson
	(
		null,
		'account',
		'updateStatus',
		{
			efId: efId,
			state: state,
			socialNetwork: socialNetwork
		},
		function() {
			window.location.reload()
		}
	);
}

function userLogout(){

	Common.Api.callJson
	(
		null,
		'Account',
		'userLogout',
		{},
		function(result){
			console.log(result);
			alert('Bye ' + result.screen_name);
			location.href='/';
		}
	)
}